
cc.Class({
    extends: cc.Component,

    properties: {
        bg1: cc.Node,
        bg2: cc.Node,
        speed: 0,
    },


    onLoad() { },

    start() {

    },

    update(dt) {
        this.bg1.y += this.speed * dt;
        this.bg2.y += this.speed * dt;
        if (this.bg1.y <= 0 - this.bg1.height) {
            this.bg1.y = this.bg2.y + this.bg2.height;
        }
        if (this.bg2.y <= 0 - this.bg2.height) {
            this.bg2.y = this.bg1.y + this.bg1.height;
        }
    },
});
